
import 'osc_author.dart';

class OscActivityEntity {
	OscAuthor author;
	OscActivityOrigin origin;
	int id;
	String pubDate;
	String content;
	int appClient;
	int commentCount;

	OscActivityEntity({this.author, this.origin, this.id, this.pubDate, this.content, this.appClient, this.commentCount});

	OscActivityEntity.fromJson(Map<String, dynamic> json) {
		author = json['author'] != null ? new OscAuthor.fromJson(json['author']) : null;
		origin = json['origin'] != null ? new OscActivityOrigin.fromJson(json['origin']) : null;
		id = json['id'];
		pubDate = json['pubDate'];
		content = json['content'];
		appClient = json['appClient'];
		commentCount = json['commentCount'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.author != null) {
      data['author'] = this.author.toJson();
    }
		if (this.origin != null) {
      data['origin'] = this.origin.toJson();
    }
		data['id'] = this.id;
		data['pubDate'] = this.pubDate;
		data['content'] = this.content;
		data['appClient'] = this.appClient;
		data['commentCount'] = this.commentCount;
		return data;
	}
}

class OscActivityOrigin {
	int id;
	int type;
	String desc;

	OscActivityOrigin({this.id, this.type, this.desc});

	OscActivityOrigin.fromJson(Map<String, dynamic> json) {
		id = json['id'];
		type = json['type'];
		desc = json['desc'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['id'] = this.id;
		data['type'] = this.type;
		data['desc'] = this.desc;
		return data;
	}
}